package com.clinic.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;

@Entity
@PrimaryKeyJoinColumn(name = "ht_obj_id")
public class Health_report extends Super_type {

	private static final long serialVersionUID = 1L;

	@Column(insertable = false, updatable = false)
	private int ht_obj_id;
	private String report_type;
	private int dr_obj_id;
	private int cc_obj_id;
	private Date report_date;
	private Date next_visit;
	@Column(length = 2048)
	private String c_o;
	@Column(length = 2048)
	private String others;
	@Column(length = 1024)
	private String me_obj_ids;
	@Column(nullable = true)
	private boolean is_analysis;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pe_obj_id", nullable = false)
	private Profile profile;

	public void setProfile(Profile profile) {
		this.profile = profile;
	}

	public Health_report() {
		super();
	}

	public Health_report(String obj_owner_name, String report_type,
			int dr_obj_id, int cc_obj_id, Date report_date, Date next_visit) {
		super(obj_owner_name);
		this.report_type = report_type;
		this.dr_obj_id = dr_obj_id;
		this.cc_obj_id = cc_obj_id;
		this.report_date = report_date;
		this.next_visit = next_visit;
	}

	public Profile getProfile() {
		return profile;
	}

	public int getHt_obj_id() {
		return ht_obj_id;
	}

	public String getReport_type() {
		return report_type;
	}

	public void setReport_type(String report_type) {
		this.report_type = report_type;
	}

	public int getDr_obj_id() {
		return dr_obj_id;
	}

	public void setDr_obj_id(int dr_obj_id) {
		this.dr_obj_id = dr_obj_id;
	}

	public int getCc_obj_id() {
		return cc_obj_id;
	}

	public void setCc_obj_id(int cc_obj_id) {
		this.cc_obj_id = cc_obj_id;
	}

	public Date getReport_date() {
		return report_date;
	}

	public void setReport_date(Date report_date) {
		this.report_date = report_date;
	}

	public Date getNext_visit() {
		return next_visit;
	}

	public void setNext_visit(Date next_visit) {
		this.next_visit = next_visit;
	}

	public String getC_o() {
		return c_o;
	}

	public void setC_o(String c_o) {
		this.c_o = c_o;
	}

	public String getOthers() {
		return others;
	}

	public void setOthers(String others) {
		this.others = others;
	}

	public String getMe_obj_ids() {
		return me_obj_ids;
	}

	public void setMe_obj_ids(String me_obj_ids) {
		this.me_obj_ids = me_obj_ids;
	}

	public boolean isIs_analysis() {
		return is_analysis;
	}

	public void setIs_analysis(boolean is_analysis) {
		this.is_analysis = is_analysis;
	}

	@Override
	public void _toString() {
		System.out.println("Enter - _toString");
		super._toString();
		System.out.println("C\\O: " + this.c_o + "\ncc_obj_id: "
				+ this.cc_obj_id + "\ndr_obj_id: " + this.dr_obj_id
				+ "\nme_obj_ids: " + this.me_obj_ids + "\nothers: "
				+ this.others + "\nreport type: " + this.report_type
				+ "\nis analysis: " + this.is_analysis + "\nnext visit: "
				+ this.next_visit + "\nreport date: " + this.report_date
				+ "\nprofile ID: " + this.profile.getPe_obj_id());
		System.out.println("Exit - _toString");
	}
}